// 执行 基于对象的字符串方法
export const StringToFun = (string, Object) => {
    var keyArray = [];
    var ValueArray = [];
    for (const key in Object) {
        keyArray.push(key);
        ValueArray.push(Object[key]);
    };
    try {
        return new Function(keyArray.join(','), 'return ' + string).apply(null, ValueArray);
    } catch (error) {
        console.error('StringToFun => Rule 字段配置错误', string, error);
    }
}